package com.hylu.springcloud.services;

import com.hylu.springcloud.dto.BookDTO;

import javax.validation.ConstraintViolationException;
import javax.validation.constraints.NotNull;

public interface EchoService {
    // 参数校验需要配置dubbo.provider.validation = true
    // 参数校验不通过会抛出ConstraintViolationException异常
    String echo(@NotNull(message = "参数不能为空") String message) throws ConstraintViolationException;

    /**
     * 书籍新增接口，用来测试参数校验功能
     *
     * @param bookDTO
     * @return
     */
    BookDTO add(BookDTO bookDTO) throws ConstraintViolationException;
}
